// request.js
export default (url, type, data, header) => {
  const front = 'http://121.40.63.233:8090';
  return new Promise((resolve, reject) => {
    wx.request({
      url: front + url,
      method: type || 'GET',
      data: data || {},
      header: header || {},
      success: (res) => {
        resolve(res.data);
      },
      fail: (err) => {
        reject(err);
      },
    });
  });
};
